#include <Windows.h>
#include <iostream>

typedef double(*FUNA)(double&, double&);
typedef double(*FUNB)(double&, double&, double&);

using std::cout;
using std::endl;
int main()
{
	const char* dllName = "CreateDll.dll";
	const char* funA = "AddPrama2";//"?add@@YANAAN0@Z";//"add";
	const char* funB = "AddPrama3";//"?add@@YANAAN00@Z";//"add";
	double a = 5.666, b = 6.777, c = 7.888;

	FUNA funa_add = nullptr;
	FUNB funb_add = nullptr;

	HMODULE hDll = LoadLibraryA(dllName);
	if (hDll)
	{
		funa_add = FUNA(GetProcAddress(hDll, funA));
		funb_add = FUNB(GetProcAddress(hDll, funB));
	}
	else
	{
		cout << "do not find dll" << endl;
	}
	if (funa_add)
	{
		cout << "add(a,b):" << endl;
		cout << "\t" << funa_add(a, b) << endl;
	}
	else
	{
		cout << "Find Function Failur!" << funA << endl;
	}
	if (funb_add)
	{
		cout << "add(a,b,c):" << endl;
		cout << "\t" << funb_add(a, b, c) << endl;
	}
	else
	{
		cout << "Find Function Failur!" << funB << endl;
	}

	FreeLibrary(hDll);

	system("pause");
	return 0;
}